Commit Graph

1553 Commits

Author SHA1 Message Date
GuEe-GUI 87906499a3 [DM/FDT] Fixup memory address reserved and translate in early
1.Fixup `fdt_reserved_memory_reg` loop time.
2.Fixup `rt_fdt_translate_address` cells value reader.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:16:56 +08:00
GuEe-GUI 3d503e931b [DRIVER/PIC] Add ARM GICv2/v3 V2M, ITS support.
Fix some code style and init for V2M, ITS.

V2M is the PCI MSI/MSI-X for GICv2.
ITS is the PCI MSI/MSI-X for GICv3/v4.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
GuEe-GUI 94e49755af [FEATURE/PIC] support PIC cancel (only in debug)
PIC may free because some wrongs in debug.
We should remove in PIC list or there are
some undefined behavior will happen.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
GuEe-GUI 04cdbc647c [FIXUP/PIC] pirq's child handler should lock less
When call the child handler, the PIC ops needn't
lock again.
Critical zone protection by PIC implementers.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
GuEe-GUI 55b40b5164 [FIXUP/PIC] set interrupt status when do traps
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
GuEe-GUI 584f4b869d [PIC/FIXUP] pirq reinit fail
don't reinit pirq's list if cascade

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
milo 2a8aba4c8b
[fix]:fix log format and reopen with a different oflag issue (#9452)
fix log format and reopen with a different oflag issue
2024-09-19 18:15:55 +08:00
Supper Thomas 6320f184f5
[doxygen] add driver example for doxygen (#9446) 2024-09-15 08:22:44 +08:00
CXSforHPU bb91502465
[drivers] Specifies the name of the drivers driver file
https://github.com/RT-Thread/rt-thread/pull/9420
2024-09-13 17:40:40 -04:00
GuEe-GUI 2d026a316a [FEATURE/OFW] add address reverse/translate for DMA/CPU's address
DMA and CPU address view is different, we need to convert them:

    +--------+    +--------+  +---------+          +--------+
    |        |    |        |  |         |          |        |
    |  CPUs  |    |  DEV0  |  |  IOMMU  <----+     |  DEV1  |
    |        |    |        |  |         |    |     |        |
    +----+---+    +----+---+  +----+----+    |     +----+---+
         |             |           |         |          |
0x200000 |      0x1000 |    0x1000 |         |   0x8000 |
         |             |           |         |          |
         +-------------+-----------+         +----------+
         |
         |
+--------v----------------------------------------------------+
|                                                             |
|                          Address BUS                        |
|                                                             |
+-------------------------------------------------------------+

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 117e6ed347 [FEATURE/FDT] Add bootargs select in early
Maybe use for memory/DMA buffer init before
ofw_node unflatten.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI cb665f932e [FIXUP/OFW] ofw_parse_object fail
The ofw parse should:
1. Check obj_name EQU the current node's rt_data.
2. Find the next object name.
3. goto "2" until obj_name EQU the cmp_cell's obj_name.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 8c456c5e33 [FIXUP/OFW] remove the last empty string for bootargs
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 06211b8be1 [FIXUP/OFW] DTS version header always v1.0
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 43701ea1ed [FIXUP/OFW] Increase append child node's ref_count
rt_ofw_append_child append a new child node and return,
ref_get is necessary.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 9fd9c1ee45 [FIXUP/OFW] rt_ofw_foreach_node_by_compatible args
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI f9b632d52d [DM/MISC] Add error no for ptr
When the driver request a API gets RT_NULL which return value is ptr,
they could not know why get a RT_NULL.

some API return RT_NULL, is not error internal maybe, it just not
supported for this platform, but the driver still could work ok,
the API can return (RT_NULL + -RT_EEMPTY) to driver.

on the other hand, the driver can do more behaviors by error no.
When the API return the -RT_EBUSY, driver can wait for a moment and retry.
When the API return the -RT_ENOSYS, driver can try the next mode or request's name.

Signed-off-by: GuEe-GUI <wusongjie@rt-thread.com>
2024-09-11 14:34:13 +08:00
CYFS cb0b5b05ad
[components][sensor]增加电源检测类型 2024-09-10 19:54:03 -04:00
SeliverWang 66dd03f6c2 修复audio_pipe中函数在开启POSIX IPC时与 POSIX PIPE冲突问题 2024-09-06 23:18:09 -04:00
GuEe-GUI 2168ed8e7d [DM/Feature] Basic PCI/PCIe (Peripheral Component Interconnect Express) bus
PCI/PCIe have better performance and more devices support, such as
NVMe, GPU, Powerful NIC (Like RDMA). PCI/PCIe can access control by
IOMMU that the virtualiztion and userspace driver will more safety.
PCI/PCIe device could hot plugging, no design modifications SoC required,
PCI/PCIe on Embedded SoC is popular now.
We make a simple framework to support them.

Feature Lists:
1.PCI INTx: the INT[A-D] pin IRQ for legacy PCI, work with platform PIC.
2.MSI/MSI-X: the message write IRQ for PCIe, work with platform's PIC.
3.PME: we only support the D0, D1, D2, D3HOT, D3COLD init by framework.
4.Endpoint: a simple EP framework for PCI FPGA or NTB function.
5.OFW: we only support work on OFW SoC, ACPI support in the future maybe.

Host controller:
1. Common PCI host controller on ECAM.
2. Generic PCI host controller on ECAM.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-06 17:45:03 -04:00
GuEe-GUI 802a6ed2ca [DM] Extended drivers MISC interface
1. RT_FIELD_PREP: prepare a bitfield element.
2. RT_FIELD_GET: extract a bitfield element.
3. rt_offsetof: member offset of a struct
4. rt_upper_32_bits: high 32 bits of value.
5. rt_lower_32_bits: lower 32 bits of value.
6. rt_upper_16_bits: high 16 bits of value.
7. rt_lower_16_bits: lower 16 bits of value.
8. rt_max_t: fix type of max(...).
9. rt_ilog2: integer logarithm base 2.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-06 17:45:03 -04:00
GuEe-GUI 175a2ff954 Fixup platform not free device in OFW
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-03 19:49:47 -04:00
GuEe-GUI 2ec69c3ce4 Fixup bus remove device option
The bus should call driver's `remove` callback not
instead of `shutdown` in rt_bus_remove_device.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-03 19:49:47 -04:00
Yaochenger 7469edd165 [fix][device] 修正使用rt_device_create创建设备,使用rt_device_destroy删除失败的问题 2024-09-03 18:24:45 -04:00
sakumisu 2d266742e0 fix(cherryusb): fix build error 2024-09-02 21:27:47 +08:00
sakumisu 9511e4bd19 update(cherryusb): fix dfs mem leak, add check for lwip stack size, select elmfat when use msc 2024-09-02 00:37:35 -04:00
zhugengyu b9f4daa97a
[BSP][Phytium] add support for mainbranch cherryusb (xhci host + pusb2 device/host) 2024-08-27 22:06:13 -04:00
sakumisu 669a6822e7 update(cherryusb): update to v1.4.0 2024-08-27 00:48:40 -04:00
CXSforHPU 416ec66380
[device] add dev_ prefix for file names 2024-08-23 18:15:09 -04:00
Shell c451dce820 feat: add ISR safe completion API
Since the completion is used to sync with ISR mostly, we should set the
default semantic to ISR-safe. So most user will be happy and don't see
any weird behavior in their codes.

Changes:
- Added `rt_completion_wait_noisr` and
  `rt_completion_wait_flags_noisr` functions in `completion.h`,
  `completion_comm.c`, `completion_mp.c`, and `completion_up.c`.
- The new APIs allow waiting for completions in non-ISR contexts
  while ensuring thread context safety.
- Existing documentation and comments were updated to clarify
  usage contexts and emphasize restrictions on ISR usage.

Signed-off-by: Shell <smokewood@qq.com>
2024-08-19 10:39:15 +08:00
Fan YANG 55c33d9ce2 [components][drivers][sdio][sd] Fix wrong max data rate calculation logic
- corrected the default value for max_data_rate variable

Signed-off-by: Fan YANG <fan.yang@hpmicro.com>
2024-08-12 16:23:17 +08:00
zhao maosheng f543160ead fix rt_atomic_dec_and_test 2024-08-09 12:54:10 +08:00
kurisaw ab11bd04bf Synchronizing sensor_v1 changes 2024-07-24 23:17:38 +08:00
kurisaw 57bca1a072 [sensor_v2] Repair an error occurs when sensor v2 probes a sensor device for the first time 2024-07-24 23:17:38 +08:00
wdfk-prog a837f2b8e9 [compoents][hwtimer]Add a user control interface 2024-07-19 11:51:39 +08:00
wdfk-prog bceb6635b0 [compoents][pm]The device is registered and uninstalled by linked list 2024-07-19 11:51:39 +08:00
zhao maosheng 393a61b048 Fix potential return value discrepancy when writing to urandom 2024-07-18 10:05:05 +08:00
Shell 65ffe4e13e [libcpu/rv64] feat: unify tick.c
The changes unify the tick.c implementations for all risc-v64
architectures, leveraging the CPUTIME feature. This refactoring was
necessary to streamline the codebase, and ensure consistent timer
handling across different platforms.

Changes:
- Updated `Kconfig` in `bsp/cvitek/cv18xx_risc-v` to fix formatting issues.
- Updated .config for BSPs to update `CPUTIME_TIMER_FREQ`
- Updated header of for API `riscv_cputime_init`
- Initialized riscv timer on `rt_hw_tick_init`
- Refactored `tick.c` and `tick.h` in `libcpu/risc-v/t-head/c906` and `libcpu/risc-v/virt64`:
  - Replaced direct use of `rdtime` with `clock_cpu_gettime`.
  - Removed redundant timer frequency definitions.
  - Added static assertions to check the value of `CPUTIME_TIMER_FREQ`.
  - Initialized `tick_cycles` based on `CPUTIME_TIMER_FREQ`.
  - Integrated `ktime` support for tick initialization.

Signed-off-by: Shell <smokewood@qq.com>
Reviewed-on: https://github.com/RT-Thread/rt-thread/pull/9164
Reviewed-by: Chen Wang <unicorn_wang@outlook.com>
2024-07-15 12:06:39 +08:00
zms123456 4e8b8290ab
[driver][virtio]fix virtio net rx error (#9170)
fix virtio net rx error
2024-07-13 22:16:03 +08:00
sakumisu 4122f6d8b8 fix(cherryusb): fix typo 2024-07-12 20:31:31 +08:00
wdfk-prog 6e7cf3a608 [components][SPI][spi-bit-ops]修复可能的异常操作
* 移除初始化时未进行引脚初始化就进行引脚设置可能导致的异常
* CS引脚配置判断完善
* xfer返回值优化
2024-07-12 17:48:17 +08:00
wdfk-prog 15a8ebe0a0
[components][driver][can]Fix possible memory overflow caused by RX
修复RX可能导致的内存溢出情况

#8634
2024-07-09 20:22:37 +08:00
Shell 3f6960b7f5
[smart/tty] skip configure of rt_serial on tty open (#9152)
Skip configure on open since all configs are copied from the current
configuration on device. So we don't bother to set it back to device
again.

Changes:

- test and skip configuration on open() of tty device

Signed-off-by: Shell <smokewood@qq.com>
2024-07-09 13:28:24 +08:00
LaterComer 4d0b048c97
[fixed]serial_v2.c兼容DFS_V2接口 (#9153) 2024-07-09 12:10:08 +08:00
Evlers 755cde372c fix a bug that read members in non-existent functions 2024-07-05 10:51:17 +08:00
Evlers 7d7993f940 fix an issue where repeated remove of card resulted in assertions 2024-07-05 10:51:17 +08:00
zhao maosheng 95aa97714b fix initrd scan err 2024-07-04 00:34:01 +08:00
sakumisu cc853de5f3
Update cherryusb to v1.3.1 (#9122)
* fix(hpmicro): remove duplicate usb variable

* update(cherryusb): update to v1.3.1
2024-06-30 08:01:51 +08:00
Shell 3d8c27bcc9
[ktime] quality: remove recursion on hrtimer (#9110)
[ktime] feat: remove recursion on hrtimer

Replace recursive algorithm with a loop in hrtimer
when determining next timeout event and setup hr timer.

Signed-off-by: Shell <smokewood@qq.com>
2024-06-28 00:22:06 +08:00
wdfk-prog 28c7522e26 [drivers][serial V1]poll tx 增加异常退出机制 2024-06-27 00:11:18 +08:00