-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[DM/MFD] Update MFD #10995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DM/MFD] Update MFD #10995
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,10 +1,21 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| menuconfig RT_USING_MFD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bool "Using Multifunction device drivers" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bool "Using Multifunction device drivers (MFD)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| depends on RT_USING_DM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default n | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config RT_MFD_EDU | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bool "Educational device driver" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| depends on RT_USING_MFD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| depends on RT_USING_PCI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| depends on RT_USING_DMA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default n | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config RT_MFD_SYSCON | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bool "System Controller Register R/W" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| depends on RT_USING_MFD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| depends on RT_USING_OFW | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default y | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if RT_USING_MFD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+19
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config RT_MFD_EDU | |
| bool "Educational device driver" | |
| depends on RT_USING_MFD | |
| depends on RT_USING_PCI | |
| depends on RT_USING_DMA | |
| default n | |
| config RT_MFD_SYSCON | |
| bool "System Controller Register R/W" | |
| depends on RT_USING_MFD | |
| depends on RT_USING_OFW | |
| default y | |
| if RT_USING_MFD | |
| if RT_USING_MFD | |
| config RT_MFD_EDU | |
| bool "Educational device driver" | |
| depends on RT_USING_MFD | |
| depends on RT_USING_PCI | |
| depends on RT_USING_DMA | |
| default n | |
| config RT_MFD_SYSCON | |
| bool "System Controller Register R/W" | |
| depends on RT_USING_MFD | |
| depends on RT_USING_OFW | |
| default y |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,332 @@ | ||||
| /* | ||||
| * Copyright (c) 2006-2023, RT-Thread Development Team | ||||
| * | ||||
| * SPDX-License-Identifier: Apache-2.0 | ||||
| * | ||||
| * Change Logs: | ||||
| * Date Author Notes | ||||
| * 2023-02-25 GuEe-GUI the first version | ||||
| */ | ||||
|
|
||||
| #include <rthw.h> | ||||
| #include <rtthread.h> | ||||
| #include <rtdevice.h> | ||||
|
|
||||
| #define DBG_TAG "mfd.edu" | ||||
| #define DBG_LVL DBG_INFO | ||||
| #include <rtdbg.h> | ||||
|
|
||||
| #include <cpuport.h> | ||||
|
|
||||
| #define PCI_EDU_REGS_BAR 0 | ||||
| #define EDU_REG_VERSION 0x00 | ||||
| #define EDU_REG_CARD_LIVENESS 0x04 | ||||
| #define EDU_REG_VALUE 0x08 | ||||
| #define EDU_REG_STATUS 0x20 | ||||
| #define EDU_REG_STATUS_IRQ 0x80 | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 格式化有点问题
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里主要是寄存器的位域,便于区分就这样写了 |
||||
| #define EDU_REG_IRQ_STATUS 0x24 | ||||
| #define EDU_REG_ISR_FACT 0x00000001 | ||||
| #define EDU_REG_ISR_DMA 0x00000100 | ||||
| #define EDU_REG_IRQ_RAISE 0x60 | ||||
| #define EDU_REG_IRQ_ACK 0x64 | ||||
| #define EDU_REG_DMA_SRC 0x80 | ||||
| #define EDU_REG_DMA_DST 0x88 | ||||
| #define EDU_REG_DMA_SIZE 0x90 | ||||
| #define EDU_REG_DMA_CMD 0x98 | ||||
| #define EDU_DMA_CMD_RUN 0x1 | ||||
| #define EDU_DMA_CMD_TO_PCI 0x0 | ||||
| #define EDU_DMA_CMD_FROM_PCI 0x2 | ||||
| #define EDU_DMA_CMD_IRQ 0x4 | ||||
|
|
||||
| #define EDU_FACTORIAL_ACK 0x00000001 | ||||
|
|
||||
| #define EDU_DMA_ACK 0x00000100 | ||||
| #define EDU_DMA_FREE (~0UL) | ||||
|
||||
| #define EDU_DMA_FREE (~0UL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Title Format Issue / PR 标题格式问题
English: The PR title "[DM/MFD] Update MFD" does not follow RT-Thread's PR title format. It should use lowercase format
[module][subsystem] Descriptionand be more specific about the changes.Based on the modified files and changes:
Suggested title:
[mfd] Add QEMU EDU device driver for PCI study中文:PR 标题 "[DM/MFD] Update MFD" 不符合 RT-Thread 的 PR 标题格式。应使用小写格式
[模块][子系统] 描述,并且应该更具体地描述变更。基于修改的文件和变更内容:
建议标题:
[mfd] Add QEMU EDU device driver for PCI study