-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[bsp/milkv 仅用于讨论-后续拆分提交]为后续使用ioremap做准备 #9120
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
Changes from all commits
9871819
0dd4ceb
e66b670
1035b88
9cc9e56
36fb2eb
c40294c
1b6ec69
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
#include <rtconfig.h> | ||
|
||
#ifdef RT_USING_SMART | ||
#include <ioremap.h> | ||
#else | ||
#define rt_ioremap(a, s) (a) | ||
#define rt_iounmap(a) | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,12 +23,9 @@ | |
#define PAD_MIPI_TXM0__MIPI_TXM0 0 | ||
#define PAD_MIPI_TXP0__MIPI_TXP0 0 | ||
|
||
#if defined(ARCH_ARM) | ||
extern rt_ubase_t pinmux_base_ioremap(void); | ||
#define PINMUX_BASE pinmux_base_ioremap() | ||
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. 对 所以我这里建议:是否可以将 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. PINMUX_BASE这个暂时保留,这次提交主要是想不太多修改原来代码基础上使用ioremap,效率问题可以后面修改 |
||
#else | ||
#define PINMUX_BASE 0x03001000 | ||
#endif /* defined(ARCH_ARM) */ | ||
|
||
#define PINMUX_MASK(PIN_NAME) FMUX_GPIO_FUNCSEL_##PIN_NAME##_MASK | ||
#define PINMUX_OFFSET(PIN_NAME) FMUX_GPIO_FUNCSEL_##PIN_NAME##_OFFSET | ||
#define PINMUX_VALUE(PIN_NAME, FUNC_NAME) PIN_NAME##__##FUNC_NAME | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <rtdef.h> | ||
#include "drv_ioremap.h" | ||
|
||
static rt_ubase_t pinmux_base = RT_NULL; | ||
|
||
rt_ubase_t pinmux_base_ioremap(void) | ||
{ | ||
if (pinmux_base == RT_NULL) | ||
{ | ||
pinmux_base = (rt_size_t)rt_ioremap((void*)0x03001000, 0x1000); | ||
} | ||
|
||
return pinmux_base; | ||
} |
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.
写法建议修改为如下方式。理由,没有必要赋值两次,定义时直接放 BSS,可以有助于减小 bin 文件 size