Commit Graph

152 Commits

Author SHA1 Message Date
Bowen Wang 7afbcc1a62 drivers/vhost: add vhost framework for NuttX
virtio is a framework to implement the virtio drivers
vhost (Virtual Host) is a framework to implement the virtio devices
With the virtio and vhost framework, we can use the virtio drivers
and vhost drivers to implement the cross-core communication.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-03 17:37:40 +08:00
dongjiuzhu1 5b48dea4f5 drivers/i3c: support i3c driver model
Reference to: https://github.com/torvalds/linux/tree/master/drivers/i3c

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-24 23:36:50 +08:00
wangjianyu3 d1b87bd021 Add thermal framework
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
dongjiuzhu1 1d5f43664d driver/pinctl: add pinctrl framework
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-17 02:25:47 +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
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
liaoao 24050ba59f coresight: add coresight_core
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
yangshuyong 75f8c72dbb drivers/pci/pci_qemu_edu: update qemu edu driver code
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +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 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
Tiago Medicci Serrano fcff5d43b7 drivers/rmt: Implement an upper-half RMT character driver
The RMT (Remote Control) character driver allows to use the RMT
peripheral (usually, a one-wire peripheral dedicated to driving
IR remote control) as a character driver.

Please note that this perpiheral depends on the lower-half specific
driver implementation.
2023-12-24 16:38:06 -08:00
likun17 f99b1a41a3 nuttx/drivers: add regmap subsystems support.
regmap: add i2c and spi bus support.

Signed-off-by: likun17 <likun17@xiaomi.com>
2023-09-27 00:46:51 +08:00
yangshuyong 6f6977d002 support nuttx reset driver model
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
2023-08-11 20:39:16 +08:00
Brennan Ashton 46b0f6d6ee fdt: Add initial FDT support and procfs for userspace export
VELAPLATFO-12536

This provides the initial hooks for Flattened Device Tree support
with QEMU RV. It also provides a new procfs file that exposes the
fdt to userspace much like the /sys/firmware/fdt endpoint in Linux.
See https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-firmware-ofw

Nodes in the fdt are not yet usable by the OS.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-05 12:41:06 -07:00
ZhongAn 596f52c3ee Nuttx/dma: add dma framework for nuttx
Signed-off-by: ZhongAn <zhongan@pinecone.net>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-04-22 01:02:51 +08:00
Masayuki Ishikawa 8b4ffb8d3e virtio: Add virtio drivers
Summary:
- This commit adds virtio-mmio and virtio-net drivers

Impact:
- None (new drivers)

Testing:
- Tested with rv-virt (will be updated later) with QEMU-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-11-29 13:16:44 +08:00
liangchaozhong 5ec4296553 move usrsock_dev.c to driver folder
Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-09-10 13:08:22 +08:00
Michał Łyszczek a9f78a64db drivers/ipcc: add Inter Processor Communication driver
This patch adds upper half driver for IPCC character driver. IPCC
is a Inter Processor Communication Controller.

Driver is still immature and not thoroughly tested, thus
CONFIG_EXPERIMENTAL is required.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2022-07-29 23:11:32 +08:00
Xiang Xiao c96c96a399 drivers: Merge the common driver initialization into one place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-13 11:24:48 -03:00
Xiang Xiao 90c01bde28 drivers: Move the common driver to misc folder
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-12 02:48:21 +08:00
chao.an 11f04e516a drivers/segger: download the RTT/SystemView from github
RTT:
https://github.com/SEGGERMicro/RTT/archive/refs/tags/V7.54.zip

SystemView:
https://github.com/SEGGERMicro/SystemView/archive/refs/tags/V3.30.zip

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-29 17:26:04 +08:00
chao.an e04ccba78a note/sysview: add Segger System View support
Reference:
https://www.segger.com/products/development-tools/systemview
https://github.com/SEGGERMicro/SystemView
https://github.com/SEGGERMicro/RTT

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-29 17:26:04 +08:00
zhuyanlin 565964a12f driver: add clk framework
N/A

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-07 01:35:45 -06:00
SPRESENSE f8d036d70b drivers/Makefile: Use the -include directive for platform/Make.defs
Since `platform` of `platform/Make.defs` is a symbolic link created during
the build process, we use -include directive instead of include for safety.
2021-08-18 23:21:47 -07:00
raiden00pl 919008c51e add upper-half CORDIC driver 2021-07-28 14:23:13 -03:00
raiden00pl e4c27dfdd6 drivers: add generic upper-half driver for Field Oriented Control (FOC) 2021-03-30 21:54:39 -03:00
Alin Jerpelea 26e1f1f249 tools: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-19 08:07:47 -08:00
Alan C. Assis f63e1e277f Add generic support to LWL Console 2021-01-26 18:21:28 -08:00
Alan C. Assis 154949403c Add generic efuse driver for NuttX
Squashed commits:

    Fix small typos on efuse driver
    Fix nxstyle issues
    Fix aligment and missing FAR
    Improvements to efuse driver
    Fix: don't free 'lower' on efuse_unregister
    Describe the efuse_param
    Remove upper pointer from lowerhalt
    Fix blank line at end of function

Co-authored-by: saramonteiro <saramonteirosouza44@gmail.com>
Co-authored-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-01-15 10:34:12 -06:00
chao.an c56785bd0d style/Makefile: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
Matias N d5b6ec450f Parallelize depend file generation 2020-11-22 09:02:59 -03:00
dongjiuzhu 2ed6e13241 driver/rc: support IR remote control
N/A

guide link: https://www.kernel.org/doc/html/v4.14/media/uapi/rc/lirc-dev.html

Change-Id: I84abfc12578d444d72c8c0df31d06d1a85ce0725
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-05 11:38:28 -03:00
Xiang Xiao f99719e260 Move note driver from drivers/syslog to drivers/note
it's better to put the note transport layer into a common folder

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-07 11:54:10 +08:00
SPRESENSE e249a2f82f Makefile: Fix Make.dep not updated by config changes
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:

 1) Add source files by config symbol
 2) Include header files in #ifdef directive

These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
2020-07-28 03:59:45 -05:00
Xiang Xiao 23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao edb0ce2d5a build: Don't need use $(DELIM) in include statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao 1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Xiang Xiao 5eae32577e build: Move INCDIROPT to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Xiang Xiao bd656888f2 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Gregory Nutt 5c0e8e88b1 Revert "Makefile: move INCDIROPT to common place (#625)"
This reverts commit b9ace36fcc.

This change was added by PR 625 but has a serious logic flaw.  It removes all occurrences of INCDIROPT and replaces it with a definition in tools/Config.mk:

    else ifeq ($(WINTOOL),y)
      DEFINE = "$(TOPDIR)/tools/define.sh"
      INCDIR = "$(TOPDIR)/tools/incdir.sh" -w

This logic flaw is the Config.mk is included in all Make.defs files BEFORE WINTOOL is defined.  As a result, the definition is wrong in many places when building under Cygwin with a Windows native toolchain.
2020-03-26 08:50:29 -07:00
Xiang Xiao b9ace36fcc
Makefile: move INCDIROPT to common place (#625) 2020-03-26 08:09:59 -06:00
YAMAMOTO Takashi 1ffa009c8b Revert "Don't generate .depend anymore"
This reverts commit 79af7fbf4e.

Because:

* btashton reported some issues in local builds:

  https://github.com/apache/incubator-nuttx/pull/603#issuecomment-602264860

* this might be related to the current CI breakage:

  > /bin/sh: 1: /__w/incubator-nuttx/incubator-nuttx/nuttx/tools/mkdeps: not found
2020-03-22 23:07:29 -05:00
Xiang Xiao 79af7fbf4e
Don't generate .depend anymore 2020-03-22 18:15:29 +00:00
Xiang Xiao 0c50499027 drivers/addrenv.c: Move up_addrenv_ implemenation to common folder. 2019-11-03 19:45:05 -06:00
Guiding Li 8b92305265 This commit brings in the drivers needed to support OpenAMP. These changes were ported from https://github.com/FishsemiCode/nuttx. The current state: Most drivers do now compile but are not yet verfied.
This port was effort of a number of people, I rather arbitrarily gave authorship to Guiding Li because he has the largest number of fundamental quashed commits from the Xiamoi repository.

Squashed commit of the following:

Author: Xiang Xiao <xiaoxiang@pinecone.net>
    include/nuttx/b2c.h and libx/libc/string:  Add non-standard string functions to deal with cases where there are more than 8-bits in a type char.

Author: Gregory Nutt <gnutt@nuttx.org>
    Fix several build issues/missing definitiona needed for OpenAMP build in drivers/.
    Add OpenAMP code has been reviewed and ran through tools/nxstyle (with all reports accounted for).

Author: Xiang Xiao <xiaoxiang@xiaomi.com>
    tools/:  Fix the minor issue in Makefile

Author: Gregory Nutt <gnutt@nuttx.org>
    drivers/rptun/rptun.c:  Review for coding standard.  Run against tools/nxstyle.
    tools/LibTargets.mk:  Fix some TABs that were turned into spaces by a copy-paste.
    fs/hostfs:  Add configure and build support for hostfs RPC.
    drivers/timer:  Add configure and build support for syslog RTC.
    drivers/syslog:  Add configure and build support for syslog RPC.
    drivers/serial:  Add configure and build support for serial RPC.
    Kconfig, tools/*.mk. openamp/:  Add basic OpenAMP build support.
    drivers/rptun:  Add configure and build support for OpenAMP tunnel drivers.
    drivers/net:  Update Make.defs and Kconfig for OpenSDA support.
    Remove drivers/clk/clk-rpmsg.c drivers/power/rpmsg_regulator.c.  These depend on upstreaming support for a new subsystem based on the clk/regulator is model from Linux.  Removed because we want to separate the activities.  We will just try to get the basic OpenAMP support in place for now.
    Remove drivers/misc/misc_rpmsg.c and include/nuttx/misc/misc_rpmsg.h.  These are specific to the Xiaomi application.

Author: zhuyanlin <zhuyanlin@pinecone.net>
    This commit brings in the OpenAMP OS driver/RPC components from https://github.com/FishsemiCode/nuttx.  Initial commit is source files only.  Additional changes to Kconfig and Make.defs files still needed.

Author: Jianli Dong <dongjianli@pinecone.net>
    This commit brings in the OpenAMP OS driver/RPC components from https://github.com/FishsemiCode/nuttx.  Initial commit is source files only.  Additional changes to Kconfig and Make.defs files still needed.

Author: Guiding Li <liguiding@pinecone.net>
    This commit brings in the OpenAMP OS driver/RPC components from https://github.com/FishsemiCode/nuttx.  Initial commit is source files only.  Additional changes to Kconfig and Make.defs files still needed.
2019-11-02 11:30:33 -06:00
Gregory Nutt 07edaa088c drivers/Kconfig: Add an option, CONFIG_DRVR_MKRD, to control whether or not the mkrd() implementation is build. Otherwise, if mkrd() is built unconditionally, it will be drawn into every build whether it is used or not and will increase the build size. 2019-10-26 11:43:34 -06:00
Gregory Nutt be325924fb This commit corrects a problem with NSH: NSH was calling the OS internal function ramdisk_register() in violation of the portable POSIX interface. This commit solves the problem by introducing a new boardctl() function BOARDIOC_MKRD which moves the RAM disk creation into the OS.
Squashed commit of the following:

    drivers/:  Run tools/nxstyle against all drivers/*.c.

    boards/boardctl.c:  Add new boardctl() command, BOARDIOC_MKRD, that can be used to create a RAM disk.  This will replace the illegal call to ramdisk_register() currently used by NSH.

    drivers/mkrd.c:  Add wrapper around ramdisk_register() for creating a proper ramdisk.
2019-10-26 09:35:32 -06:00
Augusto Fraga Giachero f08ab217b0 drivers/rf/dat-31r5-sp.c: dd support to the DAT-31R5-SP+ digital attenuator. Creates a the new device driver directory drivers/rf/ to support drivers related to RF peripherals. It also adds support for the DAT-31R5-SP+ digital attenuator. 2019-09-05 13:28:28 -06:00
Augusto Fraga Giachero 68bbc8438c drivers/timers/pwm.c: Move the pwm/pwm.c driver to timers/pwm.c, The drivers/pwm contained only one .c file (pwm.c), so to avoid the proliferation of sub-directories inside drivers/ is better to move the pwm.c driver to drivers/timers. The pwm.h header was moved to include/nuttx/timers to keep consistency, so all files referencing it need to be updated. 2019-09-02 07:57:10 -06:00